//
//  CGPoint+Extension.swift
//  XCDragCardContainer
//  Created by XC on 2023/3/1.
//
//
//

import Foundation

extension CGPoint {
    internal init(_ vector: CGVector) {
        self = CGPoint(x: vector.dx, y: vector.dy)
    }
}

extension CGPoint {
    internal static func + (lhs: CGPoint, rhs: CGPoint) -> CGPoint {
        return CGPoint(x: lhs.x + rhs.x, y: lhs.y + rhs.y)
    }
    
    internal static func - (lhs: CGPoint, rhs: CGPoint) -> CGPoint {
        return CGPoint(x: lhs.x - rhs.x, y: lhs.y - rhs.y)
    }
    
    static func * (point: CGPoint, scalar: CGFloat) -> CGPoint {
        return CGPoint(x: point.x * scalar, y: point.y * scalar)
    }
}
